﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Masters/AdminMasterPage.master"
    AutoEventWireup="true" CodeFile="OrderDetails.aspx.cs" Inherits="Admin_OrderDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Title" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">


    <div class="content-box">
        <!-- Start Content Box -->
        <div class="content-box-header">
            <h3>
                Thông tin phiếu đặt hàng</h3>
            <ul class="content-box-tabs">
                <li><a href="#tab1" class="default-tab">Phiếu đặt hàng</a></li>
            </ul>
            <div class="clear">
            </div>
        </div>
        <!-- End .content-box-header -->
        <div class="content-box-content">
           
            <input type="hidden" name="act" id="act" value="update" />
            
            <!-- Start Tab Danh Sach-->
            <div class="tab-content default-tab" id="tab1">
                <!-- This is the target div. id must match the href of this div's tab -->
                <!-- Start Notification -->
                <div id="NotificationMessage" runat="server">
                </div>
                <!-- End Notification -->
                <table width="100%" align="center">
                    <thead>
                    </thead>
                    <tfoot>
                        <tr>
                            <td>
                                <div class="bulk-actions align-left">                                   
                                    <asp:Button ID="btnThanhToan" runat="server" Text="Yêu cầu thanh toán" CssClass="button"
                                        Visible="False" onclick="btnThanhToan_Click" />
                                    <asp:Button ID="btnVanChuyen" runat="server" Text="Yêu cầu vận chuyển" CssClass="button"
                                        Visible="False" onclick="btnVanChuyen_Click" />
                                    <asp:Button ID="btnThanhToanPhiVC" runat="server" Text="Thanh toán phí vận chuyển"
                                        Visible="False" CssClass="button" onclick="btnThanhToanPhiVC_Click" />                                  
                                    <asp:Button ID="btnDuyetDonHang" runat="server" CssClass="button" Text="Duyệt đơn hàng"
                                        Visible="False" onclick="btnDuyetDonHang_Click" />
                                    <asp:Button ID="btnXoaDonHang" runat="server" CssClass="button" Text="Xóa đơn hàng"
                                        Visible="False" onclick="btnXoaDonHang_Click" />                                   
                                    
                                    <a href="OrderManager.aspx" class="button">Xem danh sách</a>
                                </div>
                                <div class="clear">
                                </div>
                                <!-- End Pagging -->
                            </td>
                        </tr>
                    </tfoot>
                    <tbody>
                        <tr style="text-align:center;">
                            <td align="center" valign="top">
                                <table align="center" width="100%">
                                    <tbody style="border:none;">
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Mã phiếu hàng:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label ID="MaPhieuDatHangLabel" runat="server" Text="MaPhieuDatHang"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Ngày đặt hàng:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="NgayDatHangTextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorNgayDatHangTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Thành tiền (USD):
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="ThanhTienTextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorThanhTienTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Phí vận chuyển (USD):
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="PhiVanChuyenTextBox" runat="server" Width="300px"></asp:TextBox>
                                            <div class="error-msg" id="ErrorPhiVanChuyenTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Khách hàng:
                                        </td>
                                        <td style="text-align: left">                                           
                                                                                           
                                                <%--<asp:DropDownList ID="KhachHangComboBox" runat="server" Width="300px">
                                                </asp:DropDownList>--%>
                                                <asp:TextBox runat="server" ID="KhachHangTextBox" Width="300px"></asp:TextBox>
                                                 <div class="error-msg" id="ErrorKhachHangTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Tình trạng:
                                        </td>
                                        <td style="text-align: left">
                                            <%--<asp:DropDownList ID="TinhTrangComboBox" runat="server" Width="300px">
                                            </asp:DropDownList>--%>        
                                            <asp:TextBox ID="TinhTrangTextBox" runat="server" Width="300px"></asp:TextBox>                                    
                                            <div class="error-msg" id="ErrorTinhTrangTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Thành phố đến:
                                        </td>
                                        <td style="text-align: left">                                            
                                                <%--<asp:DropDownList ID="ThanhPhoDenComboBox" runat="server" OnDataBound="ThanhPhoDenComboBox_DataBound"
                                                    Width="300px">
                                                </asp:DropDownList>--%>
                                                <asp:TextBox ID="ThanhPhoDenTextBox" runat="server" Enabled="False" 
                                                    Width="299px"></asp:TextBox>
                                                <div class="error-msg" id="ErrorThanhPhoDenTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Nhà vận chuyển:
                                        </td>
                                        <td style="text-align: left">
                                            <%--<asp:DropDownList ID="NhaVanChuyenComboBox" runat="server" Width="300px" OnDataBound="NhaVanChuyenComboBox_DataBound">
                                            </asp:DropDownList>--%>
                                            <asp:TextBox ID="NhaVanChuyenTextBox" runat="server" Width="300px"></asp:TextBox>
                                            <div class="error-msg" id="ErrorNhaVanChuyenTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Ngày đi dự kiến:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="NgayDiDuKienTextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorNgayDiDuKienTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Ngày đến dự kiến:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="NgayDenDuKienTextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorNgayDenDuKienTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Liên kết theo dõi:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:HyperLink ID="LienKetTheoDoiHyperLink" runat="server" onclick="window.open(this.href); return false;"></asp:HyperLink>
                                            <asp:TextBox ID="LienKetTheoDoiTextBox" runat="server" Width="300px" Visible="false" />
                                            <div class="error-msg" id="ErrorLienKetTheoDoiTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Địa chỉ giao hàng:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="DiaChiGiaoHangTextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorDiaChiGiaoHangTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Địa chỉ giao hàng thứ 2:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="DiaChiGiaoHang2TextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorDiaChiGiaoHang2TextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Điện thoại di động:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="DienThoaiDiDongTextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorDienThoaiDiDongTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr style="border:none;">
                                        <td align="right" style="text-align: right; border:none;">
                                            Điện thoại bàn:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="DienThoaiBanTextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorDienThoaiBanTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>

                                    <%--<tr>
                                        <td align="right" style="text-align: right">
                                            Thẻ mua hàng:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="MaBaoMatTheTextBox" runat="server" Width="300px" />
                                            <div class="error-msg" id="ErrorMaBaoMatTheTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>--%>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>      <!-- End Tab Danh Sach-->


          
        </div>
        <!-- End .content-box-content -->
    </div>
    

    <div class="content-box"><!-- Start Content Box -->
				
		<div class="content-box-header">
					
			<h3>Chi tiết phiếu đặt hàng</h3>
					
			<div class="clear"></div>
					
		</div> <!-- End .content-box-header -->
				
<div class="content-box-content">

<!-- Start Tab Danh Sach-->

<div class="tab-content default-tab" id="Div1"> 
<!-- This is the target div. id must match the href of this div's tab -->
				
            <%
              NhaKinhDoanhDataContext db = new NhaKinhDoanhDataContext();
              int objId = 1;
              if (Request.QueryString["id"] != null)
                  objId = Convert.ToInt32(Request.QueryString["id"].ToString());
              var query = from ctp in db.CTPhieuDatHangs where ctp.MaPDH.Equals(objId) select ctp;
              List<CTPhieuDatHang> lst = new List<CTPhieuDatHang>();
              if (query.Count<CTPhieuDatHang>() > 0)
              {
                  lst = query.ToList<CTPhieuDatHang>();
              }
              
      %>		
	<table align="center" width="100%">							
		<thead>           
			<tr>	                	
                <th>STT</th>
                <th>Tên</th>
                <th>Giá bán</th>
                <th>Số lượng</th>             
                <th>Đường dẫn</th> 
                <th>Loại tài liệu</th>            
			</tr>
								
		</thead>						 

						 
		<tbody>
          <% 
              int stt = 0;
            string tenLoaiTaiLieu = "Tài liệu cứng";
            foreach (CTPhieuDatHang obj in lst)
            {
                stt++;
                if (obj.LoaiSanPham == 1)
                {
                    tenLoaiTaiLieu = "Tài liệu mềm";
                }
                else
                {
                    tenLoaiTaiLieu = "Tài liệu cứng";
                }
	      %>
			<tr>		
                <td><%=string.Format("{0:000}", stt)%></td>
                <td><%=MD5Hash.Trim(obj.TaiLieu.ProductName)%></td>	
                <td><%=obj.GiaBan%></td>                
                <td><%=obj.SoLuong%></td>
                <td><%=obj.DuongDan%></td>		
                <td><%=tenLoaiTaiLieu%></td>                
               
			</tr>								
			
			<%
}
			%>
		</tbody>							
	</table>						
</div>

					
</div> <!-- End .content-box-content -->
				
</div>

</asp:Content>
